import numpy as np
class Solution:
    def singleNumber(self, nums) -> int:
        if not nums:
            return 0
        ans = 0
        for i in range(0,32):
            sum_bit = 0
            bit = 1<<i
            for j in range(0,len(nums)):
                if nums[j] & bit != 0:
                    sum_bit+=1

            if sum_bit%3:
                print(bit)
                ans = ans | bit

        return ans

ans = Solution()
xx = ans.singleNumber([3,4,3,3,5,5,5,0,0,0])